package factory

import "go_keep_learning/jtthink/design_patterns/factory_mdthod/model"

const (
	ProductTechBookType = iota
	ProductDailyBriefsType
)

type IProdectType int

//总工厂
type IProdectFactory interface {
	CreateProduct(t IProdectType) IProdect
}

type IProdect interface {
	GetInfo() string
}

//技术类工厂

type TechFactory struct{}

func (this *TechFactory) CreateProduct(t int) IProdect {
	switch t {
	case ProductTechBookType:
		return &model.Book{}
	}
	return nil

}

//生活用品类工厂
type DailyFacory struct {
}

func (this *DailyFacory) CreateProduct(t int) IProdect {

	switch t {
	case ProductDailyBriefsType:
		return &model.Briefs{}
	}
	return nil
}

//工厂方法就是先利用不同大的类型，来划分出不同的简单工厂
